package cn.mucang.java;

/**
 * Created by box on 2017/2/5.
 */
public class IteratorPatternDemo {
    public  static void main(String[] args) {
        NameRepository nameRepository = new NameRepository();

        for (Iterator iterator = nameRepository.getIterator(); iterator.hasNext();) {
            String name = (String )iterator.next();
            System.out.println("Name : " + name);
        }
    }
}
